package com.example.tome.component_router.dagger.module;


import com.example.tome.component_router.baseApp.BaseApplication;
import com.example.tome.component_router.retrofit.DataManager;
import com.example.tome.component_router.retrofit.RetrofitHelper;
import com.example.tome.component_router.retrofit.helper.HttpHelper;

import javax.inject.Singleton;

import dagger.Module;
import dagger.Provides;

/**
 * @Created by TOME .
 * @时间 2018/5/2 18:49
 * @描述 ${TODO}
 */

@Module
public class AppModule {

    private final BaseApplication mBaseApplication;

    public AppModule(BaseApplication application){
        this.mBaseApplication = application ;
    }

    @Provides
    @Singleton
    BaseApplication provideApplicationContext() {
        return mBaseApplication;
    }

    @Provides
    @Singleton
    HttpHelper provideHttpHelper(RetrofitHelper retrofitHelper) {
        return retrofitHelper;
    }

    @Provides
    @Singleton
    DataManager provideDataManager(HttpHelper httpHelper) {
        return new DataManager(httpHelper);
    }


}
